package run.bottle.app.service;

import org.springframework.lang.NonNull;
import run.bottle.app.model.entity.SysUser;
import run.bottle.app.security.token.AuthToken;

/**
 * Admin service interface.
 *
 * @author Lycheng
 */
public interface AdminService {

    /**
     * Expired seconds.
     */
    int ACCESS_TOKEN_EXPIRED_SECONDS = 24 * 3600;

    int REFRESH_TOKEN_EXPIRED_DAYS = 30;

    /**
     * 验证用户名密码
     * @param username 用户名
     * @param password 密码
     * @return
     */
    @NonNull
    SysUser authenticate(@NonNull String username, @NonNull String password);

    /**
     * 检查authCode并构建authToken
     *
     * @return User
     */
    @NonNull
    AuthToken authCodeCheck(@NonNull String username, @NonNull String password);

}
